<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>收藏中心</title>
<%@ include file="/page/pc/include.jsp"%>

<script type="text/javascript" src="<%=basePath%>/js/my/my_invoice.js"></script>
</head>
<body>
	<div class="wrap">
		<jsp:include page="../_my_header.jsp" />
		<div class="site_wrap18">
			<div class="site_wrap18_con">
				<div class="main">
					<jsp:include page="../_my_left.jsp" />
					<div class="rightitem">

						<div class="shdz_part">
							<div class="shdz_part_con">
								<div class="hd">
									<c:if test="${pageBean.totalCount < 20 }">
										<a href="javascript:void(0)" onclick="javascript: openAdd();" class="addInvoicebtn"><h3>新增发票信息</h3></a> 
									</c:if>
									<strong>您已创建<b>${pageBean.totalCount}</b>个发票信息</strong>
								</div>
								<div class="bd">
									<div class="address_list5">
										<c:choose>
											<c:when test="${empty pageBean.recordList }">
												<div class="noresult" style="text-align: center;height:285px;">
													<p>
														<i>
															<img style="width:100px; height:100px;" src="<%=basePath%>/statics_wx/images/icon_noorder.png" />
														</i>
														<br>
														<br>
														<br>
														<span>您还没有开票信息~</span>
													</p>
												</div>
											</c:when>
											<c:otherwise>
												<form action="<%=basePath%>/pc/my/companyInvoice" method="post" name="companyInvoiceForm" id="companyInvoiceForm">
													<ul>
														<c:forEach items="${pageBean.recordList }" var="companyInvoice">
															<li>
																<div class="box25">
																	<div class="setting_part">
																		<p>
																			<c:if test="${companyInvoice.isDefault != 1 }">
																				<a href="javascript:void(0);" onclick="javascript: setDefault('${companyInvoice.id}');">设为默认</a>
																			</c:if>
																			<a href="javascript:void(0);" onclick="javascript: doEditInvoice('${companyInvoice.id}');">编辑</a>
																		</p>
																	</div>
																	<h1>
																		<c:if test="${companyInvoice.isDefault == 1 }">
																			<em>默认发票信息</em>
																		</c:if>
																	</h1>
																	<a href="javascript:void(0);" onclick="javascript: doDelInvoice('${companyInvoice.id}');" class="icon_close"></a>
																	<dl>
																		<dt>
																			<strong>单位名称：</strong>
																			<div class="txt1">${companyInvoice.companyName }</div>
																		</dt>
																		<dt>
																			<strong>税号：</strong>
																			<div class="txt1">${companyInvoice.taxNo }</div>
																		</dt>
																		<dt>
																			<strong>注册地址：</strong>
																			<div class="txt1">${companyInvoice.registeAddress != '' ? companyInvoice.registeAddress : '--'}</div>
																		</dt>
																		<dt style="width:220px;">
																			<strong>注册电话：</strong>
																			<div class="txt1">${companyInvoice.registePhone != '' ? companyInvoice.registePhone : '--'}</div>
																		</dt>
																		<dt>
																			<strong>开户银行：</strong>
																			<div class="txt1">${companyInvoice.openBankName != '' ? companyInvoice.openBankName : '--'}</div>
																		</dt>
																		<dt style="width:220px;">
																			<strong>银行账号：</strong>
																			<div class="txt1">${companyInvoice.bankAccount != '' ? companyInvoice.bankAccount : '--'}</div>
																		</dt>
																	</dl>
																</div>
															</li>
														</c:forEach>
													</ul>
												</form>
												<jx:paging formID="companyInvoiceForm" isShowJumpToButton="true" numPerPage="5" isShowpageCount="true"></jx:paging>
											</c:otherwise>
										</c:choose>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<%-- 删除确认框 begin --%>
	<div class="popbox" id="del_box" style="display: none">
		<div class="del_box">
			<div class="hd">
				<h3>删除</h3>
				<span><a id="btn_close" href="javascript:void(0);" onclick="javascript: $('#del_box').hide();"></a></span>
			</div>
			<div class="bd">
				<div class="del_info">
					<strong> <img src="${rootPath}/statics/images/icon_tip2.png" />
					</strong>
					<div class="del_info_con">
						<h2 id="del_confirm_msg">是否该发票信息？</h2>
						<p>
							<input id="btn_delete" type="button" class="inputbtn1" value="删除" onclick="javascript: delInvoice();"/>
						</p>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%-- 删除确认框 end --%>
	
	<%-- 新增、编辑发票信息 弹出层 begin --%>
	<div class="popbox" id="invoicebox" style="display: none">
		<div class="add_addressbox" style="height:460px; width:550px;">
			<div class="hd">
				<h3>发票信息</h3>
				<span><a href="javascript:void(0);" onclick="$('#invoicebox').hide();"></a>
				</span>
			</div>
			<div class="bd">
				<form action="<%=basePath%>/pc/my/companyInvoice/saveInvoice" name="addInvoiceForm" id="addedvalue_invoice_form" method="post" onsubmit="return doCheckInvoice();">
					<div class="add_addressform">
					<dl>
						<dt>
							<strong><em></em>单位名称：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input type="hidden" name="id" id="invoiceId" value="" />
								<input id="companyName"  name="companyName" value="" type="text" class="inputstyle1" />
								<input type="hidden" id="defaultCompanyName" value="${company.companyName }" />
								<input type="hidden" id="defaultTaxNo" value="${company.taxNo }" />
							</div>
						</dt>
						<dt>
							<strong><em></em>税号：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input id="taxNo" name="taxNo" value="" type="text" class="inputstyle1" /> 
							</div>
						</dt>
						<dt>
							<strong>注册地址：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input id="registeAddress" name="registeAddress" value="" type="text" class="inputstyle1" />
							</div>
						</dt>
						<dt>
							<strong>注册电话：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input id="registePhone" name="registePhone" value="" type="text" class="inputstyle1" />
							</div>
						</dt>
						<dt>
							<strong>开户银行：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input id="openBankName" name="openBankName" value="" type="text" class="inputstyle1" />
							</div>
						</dt>
						<dt>
							<strong>银行账户：</strong>
							<div class="txt1" style="margin-left:110px;">
								<input id="bankAccount" name="bankAccount" value="" type="text" class="inputstyle1" />
							</div>
						</dt>
						<dt>
							<strong>&nbsp;</strong>
							<div class="txt1" style="margin-left: 150px;">
								<input id="btn_save_addedvalue_invoice" type="submit" class="inputbtn1" value="保存发票信息" /> 
							</div>
						</dt>
					</dl>
					</div>
				</form>
			</div>
		</div>
	</div>
	<%-- 新增、编辑发票信息 弹出层 end --%>

	<!---网站底部开始-->
	<div>
		<jsp:include page="../../footer.jsp?showQaFlag=0" />
	</div>
	<!---网站底部结束-->
</body>
</html>